package softOffer;

import java.util.Scanner;

/*
	1 2 3 4 5
	6 7 8 9 10
	11 12 13 14 15
	16 17 18 19 20
	21 22 23 24 25
*/
public class Question1 {
    public boolean Find(int target, int [][] array) {
        int row = array.length;
        if(row==0) return false;
        int col = array[0].length;
        if(col==0) return false;
        for(int i=0; i<row; i++){
            if(target>=array[i][0] && target<=array[i][col-1]){
                for(int j=0; j<col; j++){
                    if(target==array[i][j]) 
                    	return true;
                    	break;
                }
            }
        }
        return false; 
    }
}